<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div style="height: 100px;"></div>
  <div>
    <p>scopedSlots </p>
    <h1>swdasd</h1>
    <h1>标题2</h1>
    <div style="height: 100px;width: 100px;background-color:blueviolet;position: relative;left: 30px;">盒子</div>
  </div>

  <script>
    let person = [
      { id: '99', name: "小明" },
      { id: 0, name: "小明" },
      { id: 1, name: "小张" },
      { id: 2, name: "小李" },
      { id: 3, name: "小孙" },
      { id: 1, name: "小周" },
      { id: 2, name: "小陈" },
    ];

    let obj = {};
    let peon = person.reduce((cur, next, index, arr) => {
      console.log(next)
      console.log('cur', cur)
      console.log('index', index)
      console.log('arr', arr)
      obj[next.id] ? "" : obj[next.id] = true && cur.push(next);
      console.log('push_cur', cur)

      return cur;
    }, []) //设置cur默认类型为数组，并且初始值为空的数组
    console.log(peon);
    // (4) [{…}, {…}, {…}, {…}]0: {id: 0, name: "小明"}1: {id: 1, name: "小张"}2: {id: 2, name: "小李"}3: {id: 3, name: "小孙"}length: 4__proto__: Array(0)



  </script>
</body>

</html>